package com.matt.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.matt.commons.model.Model;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;

@Entity
@Data
@Table(name = "active_poll")
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
public class ActivePoll extends Model {

    @Column(columnDefinition = " varchar(32) COMMENT '活动id，只有投票活动'")
    private String activeId;

    @Column(columnDefinition = " int DEFAULT 1 COMMENT '投票类型(1 活动投票  2 教师投票)'")
    private Integer activeType;

    @Column(columnDefinition = " text  COMMENT '投票内容'")
    private String context;

    @Column(columnDefinition = " int  DEFAULT 0 COMMENT '票数，默认0'")
    private Integer poll;

    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm", timezone="GMT+8")
    @Column(columnDefinition = " datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间'")
    private Date createTime;

    @Column(columnDefinition = " int DEFAULT 0  COMMENT '是否删除   0:未删除  1:已删除'")
    private Integer deleted;


}
